
<template>
<div class="page-container page-container-detail-page" :style="{height:HEIGHT+'px'}">
  <!--面包屑导航-->
    <div class="breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>营销中心</el-breadcrumb-item>
        <el-breadcrumb-item>营销工具</el-breadcrumb-item>
        <el-breadcrumb-item>系统配置</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="page-container-detail">
  <el-form ref="dataform" :model="dataform" class="dataForm labelFontSize">
    <p class="title">系统配置</p>
    <el-form-item label="APP安卓端登录地址：" prop="androidConfigValue" class="mb30" label-width="200px">
      <el-input class="longInput mr10" v-model="dataform.androidConfigValue" placeholder="请输入" clearable></el-input>
    </el-form-item>
    <el-form-item label="APP苹果端登录地址：" class="mb30" prop="iosConfigValue" label-width="200px">
      <el-input class="longInput mr10" v-model="dataform.iosConfigValue" placeholder="请输入" clearable></el-input>
    </el-form-item>
    <el-form-item label="H5端登录地址：" class="mb20" prop="h5ConfigValue" label-width="200px">
      <el-input class="longInput mr10" v-model="dataform.h5ConfigValue" placeholder="请输入" clearable></el-input>
    </el-form-item>
    <el-form-item class="btns">
      <el-button type="primary" @click="saveMarketConf()" class="searchButton">保存</el-button>
    </el-form-item>
  </el-form>
  </div>
  </div>
</template>

<script>
  import KtButton from "@/views/Core/KtButton";
  import marketRequest from "@/market/request/marketRequest";
  export default {
    components: {
      KtButton,
    },
    data() {

      return {
        HEIGHT:window.innerHeight,
        deptType:localStorage.getItem("deptType"),//当前登录用户所属组织类型
        dataform: {
          androidConfigValue:"",
          iosConfigValue:"",
          h5ConfigValue:"",
        },
        dataFormRules: {
          androidConfigValue: [{ required: true, message: 'APP安卓端登录地址不能为空'}],
          iosConfigValue: [{ required: true, message: 'APP苹果端登录地址不能为空'}],
          h5ConfigValue: [{ required: true, message: 'H5端登录地址不能为空'}],
        },
      }
    },
    methods: {
      /**
       * 获取当前组织第三方跳转链接配置
       */
      saveMarketConf() {
        let that = this;
        if(that.dataform.androidConfigValue=='' && that.dataform.iosConfigValue==''  && that.dataform.h5ConfigValue=='' ){
          that.$message({ message: '请至少填写一条数据', type: "error" });
        } else{
          marketRequest.thirdPartyJumpLinks(that.dataform,res=>{
            if (res.code == "0000") {
              that.$message({ message: res.data, type: "success" });
            }
          });
        }
        
      },
      /**
       * 获取当前组织第三方跳转链接配置
       */
      getDeptJumpLinks() {
        let that = this;
         marketRequest.getDeptJumpLinks({},res=>{
            if (res.code == "0000") {
              that.dataform = res.data;
            }
          });
      }

    },
    mounted() {
      this.getDeptJumpLinks();
    }
  }
</script>

<style lang="scss" scoped>
.title{
  font-size: 20px;
  color: #333333;
  margin-bottom: 35px;
}
.labelFontSize{
  /deep/ .el-form-item__label{
    font-size: 18px !important;
  }
}
.rate{
  /deep/ .el-input{
    width: 112px !important;
  }
}
/deep/ .longInput{
  width: 285px !important;
}
.text{
  display: inline-block;
  width: 430px;
  font-size: 12px;
  margin-left: 68px;
  margin-bottom: 80px;
}
.mr10{
  margin-right: 10px;
}
.btns{
  padding-left: 100px;
  margin-bottom: 67px;
  /deep/ .el-button{
    width: 102px;
    height: 32px;
  }
  /deep/ .el-button:nth-child(1){
    margin-right: 60px;
  }
}
.lh10{
  line-height: 20px;
}
</style>



